load("@prelude//toolchains/android/tools:build_rules.bzl", "OPEN_JDK_COMPILER_ARGS", "buck_java_library", "standard_java_test")
load("@prelude//utils:source_listing.bzl", "source_listing")

oncall("android_devxx")

source_listing()

buck_java_library(
    name = "testutil",
    srcs = glob(
        ["*.java"],
        exclude = [
            "*Benchmark.java",
            "*Test.java",
        ],
    ),
    visibility = ["prelude//toolchains/android/test/..."],
    deps = [
        "prelude//toolchains/android/src/com/facebook/buck/android:helpers",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/core:core",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java:steps",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java:support",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/abi/source/api:api",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/classes:classes",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/lang/model:model",
        "prelude//toolchains/android/src/com/facebook/buck/step:step",
        "prelude//toolchains/android/src/com/facebook/buck/test/result/type:type",
        "prelude//toolchains/android/src/com/facebook/buck/test/selectors:selectors",
        "prelude//toolchains/android/src/com/facebook/buck/util:process_executor",
        "prelude//toolchains/android/src/com/facebook/buck/util:util",
        "prelude//toolchains/android/src/com/facebook/buck/util/environment:environment",
        "prelude//toolchains/android/src/com/facebook/buck/util/environment:platform",
        "prelude//toolchains/android/src/com/facebook/buck/util/unit:unit",
        "prelude//toolchains/android/src/com/facebook/buck/util/zip:zip",
        "prelude//toolchains/android/test/com/facebook/buck/jvm/java/testutil/compiler:compiler",
        "prelude//toolchains/android/test/com/facebook/buck/testutil/integration:util",
        "prelude//toolchains/android/third-party:args4j",
        "prelude//toolchains/android/third-party:asm",
        "prelude//toolchains/android/third-party:dd-plist",
        "prelude//toolchains/android/third-party:ddmlib",
        "prelude//toolchains/android/third-party:guava",
        "prelude//toolchains/android/third-party:infer-annotations",
        "prelude//toolchains/android/third-party:jackson-annotations",
        "prelude//toolchains/android/third-party:jackson-core",
        "prelude//toolchains/android/third-party:jackson-databind",
        "prelude//toolchains/android/third-party:jsr305",
        "prelude//toolchains/android/third-party:junit",
        "prelude//toolchains/android/third-party:okhttp",
        "prelude//toolchains/android/third-party:okio",
        "prelude//toolchains/android/third-party:tools-sdk-common",
    ],
)

standard_java_test(
    name = "abi",
    _java_toolchain = "toolchains//:java_for_android",
    env = {
        "KOTLIN_VERSION": read_config("kotlin", "kotlin_version"),
    },
    vm_args = OPEN_JDK_COMPILER_ARGS,
    with_test_data = True,
    deps = [
        "prelude//toolchains/android/src/com/facebook/buck/android:helpers",
        "prelude//toolchains/android/src/com/facebook/buck/cd/resources/proto:javacd-model",
        "prelude//toolchains/android/src/com/facebook/buck/core/filesystems:filesystems",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/core:core",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java:steps",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java:support",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/abi:abi",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/abi/source:source",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/abi/source/api:api",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/classes:classes",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/lang/model:model",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/version/utils:utils",
        "prelude//toolchains/android/src/com/facebook/buck/step:step",
        "prelude//toolchains/android/src/com/facebook/buck/test/result/type:type",
        "prelude//toolchains/android/src/com/facebook/buck/test/selectors:selectors",
        "prelude//toolchains/android/src/com/facebook/buck/util:process_executor",
        "prelude//toolchains/android/src/com/facebook/buck/util:util",
        "prelude//toolchains/android/src/com/facebook/buck/util/environment:environment",
        "prelude//toolchains/android/src/com/facebook/buck/util/environment:platform",
        "prelude//toolchains/android/src/com/facebook/buck/util/unarchive:unarchive",
        "prelude//toolchains/android/src/com/facebook/buck/util/unit:unit",
        "prelude//toolchains/android/src/com/facebook/buck/util/zip:zip",
        "prelude//toolchains/android/test/com/facebook/buck/jvm/java/abi:testutil",
        "prelude//toolchains/android/test/com/facebook/buck/jvm/java/testutil/compiler:compiler",
        "prelude//toolchains/android/test/com/facebook/buck/jvm/kotlin/testutil/compiler:compiler",
        "prelude//toolchains/android/test/com/facebook/buck/testutil:testutil",
        "prelude//toolchains/android/test/com/facebook/buck/testutil/integration:util",
        "prelude//toolchains/android/third-party:args4j",
        "prelude//toolchains/android/third-party:asm",
        "prelude//toolchains/android/third-party:dd-plist",
        "prelude//toolchains/android/third-party:ddmlib",
        "prelude//toolchains/android/third-party:guava",
        "prelude//toolchains/android/third-party:infer-annotations",
        "prelude//toolchains/android/third-party:jackson-annotations",
        "prelude//toolchains/android/third-party:jackson-core",
        "prelude//toolchains/android/third-party:jackson-databind",
        "prelude//toolchains/android/third-party:jsr305",
        "prelude//toolchains/android/third-party:junit",
        "prelude//toolchains/android/third-party:kotlin-annotations",
        "prelude//toolchains/android/third-party:kotlin-stdlib",
        "prelude//toolchains/android/third-party:kotlinx-coroutines-core-jvm",
        "prelude//toolchains/android/third-party:mockito",
        "prelude//toolchains/android/third-party:okhttp",
        "prelude//toolchains/android/third-party:okio",
        "prelude//toolchains/android/third-party:tools-sdk-common",
    ],
)
